#define _CRT_SECURE_NO_WARNINGS
#include "SimpleString.h"
#include<cstring>
#include<cstdio>

int SimpleString::length()
{
	return strlen(str);
}

void SimpleString::input()
{
	scanf("%s", str);
}

void SimpleString::output()
{
	printf("%s\n", str);
}

SimpleString SimpleString::operator+(const SimpleString& b) const
{
	SimpleString c = *this;
	strcpy(c.str + c.length(), b.str);
	return c;
}

SimpleString::SimpleString(const char* s)
{
	if (s == nullptr)
	{
		str[0] = '\0';
		return;
	}
	strcpy(str, s);
}

SimpleString::~SimpleString()
{
}

SimpleString::SimpleString(const SimpleString&b)
{
	strcpy(str, b.str);
}

SimpleString& SimpleString::operator=(const SimpleString&b)
{
	if (this == &b)
	{
		return *this;
	}
	strcpy(str, b.str);
	return *this;
}
ostream& operator<<(ostream& ot, const SimpleString& s)
{
	ot << s.str;
	return ot;
}

istream& operator>>(istream& it, SimpleString& s)
{
//	it.get(s.str, s.N);
	it >> s.str;
	return it;
}
